package ypmits.simpledraw {
	import flash.display.Sprite;

	/**
	 * @author Dave Lenz
	 */
	public class Triangle extends Sprite {
		
		/**
		 * Registrationpoint is below in the middle
		 * 
		 *     /\
		 *    /  \
		 *   /    \
		 *  /___*__\
		 *  
		 */
		public function Triangle( width : Number = 10, height : Number = 10, color : uint = 0xFFFFFF, edge : Boolean = false, edgeColor : uint = 0x000000, edgeThickness : Number = 1, buttonmode :Boolean = true ) {
			graphics.beginFill( color );
			if( edge ) {
				graphics.lineStyle( edgeThickness, edgeColor );
			}
			graphics.moveTo(-(width * .5), 0);
			graphics.lineTo(width* .5, 0);
			graphics.lineTo(0, -height);
			graphics.endFill();
			
			buttonMode = buttonmode;
		}
	}
}
